Es gab einige Schwierigkeiten den Zabbix Container zum Laufen zu bringen (vermutlich lag es am :latest Image).
Anstatt die Container einzeln zu starten habe ihc beschlossen mal Compose zu testen. Alle Infos und Variablen innerhalb einer Datei. Zuvor noch alle Images gepullt.
Eine docker-compose.yml erstellen
1 |
nano docker-compose.yml |
Die ENV VIRTUAL_HOST ist für den /jwilder reverse Proxy.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
zabbix-db-storage: image: busybox:latest volumes: - /var/lib/mysql zabbix-db: image: zabbix/zabbix-db-mariadb volumes: - /backups:/backups - /etc/localtime:/etc/localtime:ro volumes_from: - zabbix-db-storage environment: - MARIADB_USER=zabbix - MARIADB_PASS=dasneuepasswort zabbix-server: image: zabbix/zabbix-3.0:3.0.0 ports: - "80" - "10051:10051" volumes: - /etc/localtime:/etc/localtime:ro links: - zabbix-db:zabbix.db environment: - VIRTUAL_HOST=zabbix.buyenne.com - ZS_DBHost=zabbix.db - ZS_DBUser=zabbix - ZS_DBPassword=dasneuepasswort |
Docker Container Start
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
~/docker-zabbix-3.0 # docker-compose up -d Creating dockerzabbix30_zabbix-db-storage_1 Creating dockerzabbix30_zabbix-db_1 Pulling zabbix-server (zabbix/zabbix-3.0:3.0.0)... 3.0.0: Pulling from zabbix/zabbix-3.0 a3ed95caeb02: Pull complete a07226856d92: Already exists fd3ec3ebef01: Pull complete 07128692c5c3: Pull complete 1894d5cacea2: Pull complete 0721bf982f36: Pull complete Digest: sha256:bf4650bb186fcba42bff3ad8bc424ed55da0e50b93117285f0a98b75dc9f2bea Status: Downloaded newer image for zabbix/zabbix-3.0:3.0.0 Creating dockerzabbix30_zabbix-server_1 |
Logs DB Container
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
~/docker-zabbix-3.0 # docker logs 87a2946ac2ee => An empty/uninitialized MariaDB volume is detected in /var/lib/mysql => Installing MariaDB... => Installing MariaDB... Done! ----------------- Previous error log ----------------- 160223 20:38:18 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.28-76.1 started; log sequence number 0 160223 20:40:58 [Note] InnoDB: FTS optimize thread exiting. 160223 20:40:58 [Note] InnoDB: Starting shutdown... 160223 20:41:02 [Note] InnoDB: Shutdown completed; log sequence number 1616697 160223 20:41:02 [Note] InnoDB: Using mutexes to ref count buffer pool pages 160223 20:41:02 [Note] InnoDB: The InnoDB memory heap is disabled 160223 20:41:02 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 160223 20:41:02 [Note] InnoDB: Memory barrier is not used 160223 20:41:02 [Note] InnoDB: Compressed tables use zlib 1.2.7 160223 20:41:02 [Note] InnoDB: Using Linux native AIO 160223 20:41:02 [Note] InnoDB: Using CPU crc32 instructions 160223 20:41:02 [Note] InnoDB: Initializing buffer pool, size = 768.0M 160223 20:41:02 [Note] InnoDB: Completed initialization of buffer pool 160223 20:41:02 [Note] InnoDB: Highest supported file format is Barracuda. 160223 20:41:03 [Note] InnoDB: 128 rollback segment(s) are active. 160223 20:41:03 [Note] InnoDB: Waiting for purge to start 160223 20:41:03 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.28-76.1 started; log sequence number 1616697 160223 20:41:06 [Note] InnoDB: FTS optimize thread exiting. 160223 20:41:06 [Note] InnoDB: Starting shutdown... 160223 20:41:10 [Note] InnoDB: Shutdown completed; log sequence number 1616707 ----------------- Previous error log ends ----------------- Waiting for DB service... Still waiting for DB service... 160223 20:41:11 mysqld_safe Logging to '/var/lib/mysql/error.log'. 160223 20:41:11 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 160223 20:41:11 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 160223 20:41:11 [Warning] options --log-slow-admin-statements, --log-queries-not-using-indexes and --log-slow-slave-statements have no effect if --log_slow_queries is not set 160223 20:41:11 [Note] /usr/sbin/mysqld (mysqld 10.0.24-MariaDB) starting as process 334 ... 160223 20:41:11 [Warning] Could not increase number of max_open_files to more than 4096 (request: 4407) 160223 20:41:11 [Note] InnoDB: Using mutexes to ref count buffer pool pages 160223 20:41:11 [Note] InnoDB: The InnoDB memory heap is disabled 160223 20:41:11 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 160223 20:41:11 [Note] InnoDB: Memory barrier is not used 160223 20:41:11 [Note] InnoDB: Compressed tables use zlib 1.2.7 160223 20:41:11 [Note] InnoDB: Using Linux native AIO 160223 20:41:11 [Note] InnoDB: Using CPU crc32 instructions 160223 20:41:11 [Note] InnoDB: Initializing buffer pool, size = 768.0M 160223 20:41:11 [Note] InnoDB: Completed initialization of buffer pool 160223 20:41:11 [Note] InnoDB: Highest supported file format is Barracuda. 160223 20:41:11 [Note] InnoDB: 128 rollback segment(s) are active. 160223 20:41:11 [Note] InnoDB: Waiting for purge to start 160223 20:41:11 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.28-76.1 started; log sequence number 1616707 160223 20:41:11 [Note] Plugin 'FEEDBACK' is disabled. 160223 20:41:11 [Note] Server socket created on IP: '0.0.0.0'. 160223 20:41:11 [Warning] 'user' entry 'root@87a2946ac2ee' ignored in --skip-name-resolve mode. 160223 20:41:11 [Warning] 'user' entry '@87a2946ac2ee' ignored in --skip-name-resolve mode. 160223 20:41:11 [Warning] 'proxies_priv' entry '@% root@87a2946ac2ee' ignored in --skip-name-resolve mode. Still waiting for DB service... 160223 20:41:12 [Note] Reading of all Master_info entries succeded 160223 20:41:12 [Note] Added new Master_info '' to hash table 160223 20:41:12 [Note] /usr/sbin/mysqld: ready for connections. Version: '10.0.24-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server 160223 20:41:12 [Note] /usr/sbin/mysqld: ready for connections. Securing and tidying DB... Securing and tidying DB... Done! Showing DB status... -------------- mysql Ver 15.1 Distrib 10.0.24-MariaDB, for Linux (x86_64) using readline 5.1 Connection id: 7 Current database: Current user: root@127.0.0.1 SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server: MariaDB Server version: 10.0.24-MariaDB MariaDB Server Protocol version: 10 Connection: localhost via TCP/IP Server characterset: utf8 Db characterset: utf8 Client characterset: utf8 Conn. characterset: utf8 TCP port: 3306 Uptime: 3 sec Threads: 1 Questions: 16 Slow queries: 1 Opens: 1 Flush tables: 1 Open tables: 64 Queries per second avg: 5.333 -------------- Creating DB admin user... => Creating MariaDB user 'zabbix' with 'dasneuepasswort' password. ======================================================================== You can now connect to this MariaDB Server using: mysql -uzabbix -pdasneuepasswort -h<host> For security reasons, you might want to change the above password. The 'root' user has no password but only allows local connections ======================================================================== |
Logs Zabbix Container. Wie man sieht dauert die DB Installation knapp 25 Minuten. Einfach abwarten und den Container nicht stoppen.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
~/docker-zabbix-3.0 # docker logs --follow 4f8719537e4d Nginx status page: allowed address set to 127.0.0.1. PHP-FPM status page: allowed address set to 127.0.0.1. [LOG 20:38:43] Preparing server configuration [LOG 20:39:39] Config updated. [LOG 20:39:39] Enabling logging and pid management [LOG 20:39:48] Done [LOG 20:39:48] Waiting for database server [LOG 20:39:48] Waiting for database server, it's still not available [LOG 20:39:53] Waiting for database server, it's still not available [LOG 20:39:58] Waiting for database server, it's still not available [LOG 20:40:03] Waiting for database server, it's still not available [LOG 20:40:08] Waiting for database server, it's still not available [LOG 20:40:13] Waiting for database server, it's still not available [LOG 20:40:18] Waiting for database server, it's still not available [LOG 20:40:23] Waiting for database server, it's still not available [LOG 20:40:28] Waiting for database server, it's still not available [LOG 20:40:33] Waiting for database server, it's still not available [LOG 20:40:38] Waiting for database server, it's still not available [LOG 20:40:43] Waiting for database server, it's still not available [LOG 20:40:49] Waiting for database server, it's still not available [LOG 20:40:54] Waiting for database server, it's still not available [LOG 20:40:59] Waiting for database server, it's still not available [LOG 20:41:04] Waiting for database server, it's still not available [LOG 20:41:09] Waiting for database server, it's still not available [LOG 20:41:14] Waiting for database server, it's still not available [LOG 20:41:19] Database server is available [LOG 20:41:19] Checking if database exists or SQL import is required [WARNING 20:41:19] Zabbix database doesn't exist. Installing and importing default settings [LOG 20:41:19] Database and user created, importing default SQL [LOG 22:04:59] Import finished, starting [LOG 22:04:59] Starting Zabbix version 3.0.0 2016 2016-02-23 22:04:59,936 CRIT Supervisor running as root (no user in config file) 2016-02-23 22:04:59,936 WARN Included extra file "/etc/supervisor.d/zabbix-agent.conf" during parsing 2016-02-23 22:04:59,936 WARN Included extra file "/etc/supervisor.d/zabbix-server.conf" during parsing 2016-02-23 22:04:59,936 WARN Included extra file "/etc/supervisor.d/php-fpm.conf" during parsing 2016-02-23 22:04:59,936 WARN Included extra file "/etc/supervisor.d/nginx.conf" during parsing 2016-02-23 22:04:59,963 INFO RPC interface 'supervisor' initialized 2016-02-23 22:04:59,963 INFO supervisord started with pid 1101 2016-02-23 22:05:00,965 INFO spawned: 'nginx' with pid 1104 2016-02-23 22:05:00,967 INFO spawned: 'nginx-reload' with pid 1105 2016-02-23 22:05:00,969 INFO spawned: 'php-fpm' with pid 1106 2016-02-23 22:05:00,971 INFO spawned: 'zabbix-agent' with pid 1107 2016-02-23 22:05:00,973 INFO spawned: 'zabbix-server' with pid 1108 2016-02-23 22:05:00,979 DEBG 'nginx' stderr output: 2016/02/23 22:05:00 [notice] 1104#0: using the "epoll" event method 2016/02/23 22:05:00 [notice] 1104#0: nginx/1.8.1 2016/02/23 22:05:00 [notice] 1104#0: built by gcc 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) 2016/02/23 22:05:00 [notice] 1104#0: OS: Linux 3.19.0-49-generic 2016/02/23 22:05:00 [notice] 1104#0: getrlimit(RLIMIT_NOFILE): 524288:1048576 2016-02-23 22:05:00,981 DEBG 'nginx' stderr output: 2016/02/23 22:05:00 [notice] 1104#0: start worker processes 2016/02/23 22:05:00 [notice] 1104#0: start worker process 1110 2016/02/23 22:05:00 [notice] 1104#0: start worker process 1111 2016/02/23 22:05:00 [notice] 1104#0: start worker process 1112 2016/02/23 22:05:00 [notice] 1104#0: start worker process 1113 2016/02/23 22:05:00 [notice] 1104#0: start worker process 1114 2016/02/23 22:05:00 [notice] 1104#0: start worker process 1115 2016-02-23 22:05:00,981 DEBG 'nginx' stderr output: 2016/02/23 22:05:00 [notice] 1104#0: start worker process 1116 2016/02/23 22:05:00 [notice] 1104#0: start worker process 1118 2016-02-23 22:05:00,993 DEBG 'zabbix-agent' stdout output: Starting Zabbix Agent [Zabbix server]. Zabbix 3.0.0 (2016-02-23) (revision {ZABBIX_REVISION}). Press Ctrl+C to exit. 1120:20160223:220500.993 Starting Zabbix Agent [Zabbix server]. Zabbix 3.0.0 (2016-02-23) (revision {ZABBIX_REVISION}). 1120:20160223:220500.993 **** Enabled features **** 1120:20160223:220500.993 IPv6 support: YES 1120:20160223:220500.993 TLS support: YES 1120:20160223:220500.993 ************************** 1120:20160223:220500.993 using configuration file: /usr/local/etc/zabbix_agentd.conf 2016-02-23 22:05:00,994 DEBG 'zabbix-agent' stdout output: 1120:20160223:220500.993 agent #0 started [main process] 1121:20160223:220500.994 agent #1 started [collector] 2016-02-23 22:05:00,994 DEBG 'zabbix-agent' stdout output: 1122:20160223:220500.994 agent #2 started [listener #1] 2016-02-23 22:05:00,995 DEBG 'zabbix-agent' stdout output: 1125:20160223:220500.995 agent #5 started [active checks #1] 1123:20160223:220500.995 agent #3 started [listener #2] 2016-02-23 22:05:00,996 DEBG 'zabbix-agent' stdout output: 1124:20160223:220500.996 agent #4 started [listener #3] 2016-02-23 22:05:00,998 DEBG 'zabbix-agent' stdout output: 1125:20160223:220500.998 active check configuration update from [127.0.0.1:10051] started to fail (cannot connect to [[127.0.0.1]:10051]: [111] Connection refused) 2016-02-23 22:05:01,072 DEBG fd 14 closed, stopped monitoring <POutputDispatcher at 13179288 for <Subprocess at 12694520 with name php-fpm in state STARTING> (stdout)> 2016-02-23 22:05:01,073 DEBG fd 18 closed, stopped monitoring <POutputDispatcher at 13179000 for <Subprocess at 12694520 with name php-fpm in state STARTING> (stderr)> 2016-02-23 22:05:02,075 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2016-02-23 22:05:02,075 INFO success: nginx-reload entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2016-02-23 22:05:02,075 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2016-02-23 22:05:02,075 INFO success: zabbix-agent entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2016-02-23 22:05:02,075 INFO success: zabbix-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2016-02-23 22:06:00,004 DEBG 'zabbix-agent' stdout output: 1125:20160223:220600.004 active check configuration update from [127.0.0.1:10051] is working again 1125:20160223:220600.004 no active checks on server [127.0.0.1:10051]: host [Zabbix server] not monitored |
Anschließend noch den Docker Agent starten – Github
1 |
~/docker-zabbix-3.0 # docker run --name=zabbix-agent-xxl -h "arktur.buyenne.com" -p 10050:10050 -v /:/rootfs -v /var/run:/var/run -e "ZA_Server=5.9.52.5>" -d monitoringartist/zabbix-agent-xxl-limited:latest |
Weitere Infos hierzu gibt es hier